import tensorflow as tf
import numpy as np
def kron(a,b):
    [am,an]=a.shape.as_list()
    [bm,bn]=b.shape.as_list()
    # [am,an]=np.shape(a)
    # [bm,bn]=np.shape(b)
    a = tf.reshape(a,[am,1,an,1])
    b = tf.reshape(b,[1,bm,1,bn])
    K = tf.reshape(tf.multiply(a,b),[am*bm,an*bn])
    # K =tf.multiply(a,b)

    return K